<template>
    <view>
        <view class="input-container" style="margin-top: 20rpx;">
           
                <view class="title">账户资料</view>
                <view class="uni-row input-item">
                    <view class="input-name">开户行</view>
                    <view class="input">
                        <input type="text" :disabled="disabled" v-model="opening_bank" placeholder="填写开户行名称"
                            placeholder-style="font-size:28rpx;color:#999999" />
                    </view>
                </view>
                <view class="uni-row input-item">
                    <view class="input-name">银行卡号</view>
                    <view class="input">
                        <input type="text" :disabled="disabled" v-model="bank_card" placeholder="请填写银行卡号"
                            placeholder-style="font-size:28rpx;color:#999999" />
                    </view>
                </view>
           
        </view>
        <button class="big-btn" @tap="tijiaoshenqing()">{{btn_text}}</button>
    </view>
</template>

<script>
    import {
        getlogin
    } from '@/static/js/login.js';
    import httpPath from '@/static/js/path.js';
    export default {
        data() {
            return {
                opening_bank:"",
                bank_card:"",
                userinfo:{},
                wxinfo_id:"",
                btn_text:"立即提交"
            };
        },
        onShow() {
            this.getinfo()
        },
        onLoad() {
            this.userinfo = getlogin();
            this.wxinfo_id = this.userinfo.wxinfo_id;
        },
        methods: {
            getinfo(){
                uni.request({
                	url: httpPath.filePath + '/index/wxinfo/bankmsg', //短信验证码。
                	method: 'POST',
                	header: { 'content-type': 'application/x-www-form-urlencoded' },
                	data: { wxinfo_id:this.wxinfo_id },
                	success: res => {
                		if(res.data.code==200){
                            if(res.data.data.bank_card!=""&&res.data.data.opening_bank!=""){
                                this.bank_card=res.data.data.bank_card;
                                this.opening_bank=res.data.data.opening_bank;
                               
                            }
                            
                        }
                	}
                });
            },
            /**
             * 提交表单
             */
            tijiaoshenqing(){
                if(this.opening_bank==""||this.opening_bank==null){
                    uni.showModal({
                        showCancel:false,
                        content:"请填写开户行"
                    })
                    return false;
                }
                if(this.bank_card==""||this.bank_card==null){
                    uni.showModal({
                        showCancel:false,
                        content:"请填写银行卡号"
                    })
                    return false;
                }
                uni.request({
                	url: httpPath.filePath + '/index/wxinfo/addbank', //短信验证码。
                	method: 'POST',
                	header: { 'content-type': 'application/x-www-form-urlencoded' },
                	data: { opening_bank: this.opening_bank,bank_card:this.bank_card,wxinfo_id:this.wxinfo_id },
                	success: res => {
                		if(res.data.code==200){
                            uni.showModal({
                                showCancel:false,
                                content:"提交成功"
                            })
                        }
                	}
                });
                
            }
            
        },
    }
          
</script>

<style>
    page {
        background: #f9f9f9;
    }

    .address-title {
        font-size: 32rpx;
        font-weight: bold;
        color: #7adba8;
        text-align: center;
        padding-bottom: 20rpx;
    }

    .scroll-view {
        height: 100%;
    }

    .city-name {
        height: 90rpx;
        line-height: 90rpx;
        font-size: 28rpx;
        color: #666;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .city-name image {
        width: 36rpx;
        height: 36rpx;
        vertical-align: middle;
        margin-right: 20rpx;
    }

    .address-container {
        z-index: 100000;
        position: fixed;
        bottom: 0rpx;
        left: 0px;
        background: #fff;
        height: 662rpx;
        padding: 32rpx;
        box-sizing: border-box;
        width: 100%;
    }

    .address-item {
        width: 33.3%;
        height: 550rpx;
        box-sizing: border-box;
    }

    .gundong {
        height: 300rpx;
    }

    .tanchukuang {
        z-index: 10000;
    }

    .phone-kuang {
        position: fixed;
        top: 340rpx;
        left: 32rpx;
        width: 686rpx;
        background: #ffffff;
        border-radius: 5px;
        padding: 80rpx 45rpx;
        box-sizing: border-box;
    }

    .bang-title {
        font-size: 32rpx;
        text-align: center;
        font-weight: bold;
    }

    .bang-item {
        height: 60rpx;
        line-height: 60rpx;
        margin-top: 40rpx;
    }

    .bang-item image {
        width: 45rpx;
        height: 45rpx;
        vertical-align: middle;
        margin-right: 64rpx;
    }

    .bang-item input {
        border: none;
        font-size: 28rpx;
    }

    .code-btn {
        width: 129rpx;
        height: 64rpx;
        color: rgba(56, 209, 128, 1);
        border: 1px solid rgba(56, 209, 128, 1);
        border-radius: 12rpx;
        position: absolute;
        top: -15rpx;
        font-size: 28rpx;
        right: 10rpx;
    }

    .bang-btn {
        margin-top: 80rpx;
        width: 404rpx;
        height: 90rpx;
        line-height: 90rpx;
        background: linear-gradient(135deg, rgba(80, 80, 80, 1), rgba(51, 51, 51, 1));
        border-radius: 45rpx;
        font-size: 28rpx;
        color: #ffffff;
    }

    .closebangding {
        width: 54rpx;
        height: 54rpx;
        position: fixed;
        bottom: 120rpx;
        left: calc(50% - 27rpx);
    }

    .xuanze-item {
        height: 80rpx;
        font-size: 28rpx;
        color: #666666;
        line-height: 80rpx;
        padding-left: 150rpx;
    }

    .xuanze-item image {
        width: 36rpx;
        height: 36rpx;
        vertical-align: middle;
        margin-right: 20rpx;
    }
</style>
